package cn.edu.paisi.controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.edu.paisi.entity.Subjectinfo;
import cn.edu.paisi.service.ISubjectinfoService;
import cn.edu.paisi.util.RestResult;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author en.edu.paisi
 * @since 2021-03-09
 */
@RestController
@CrossOrigin
public class SubjectinfoController {
	@Autowired
	private ISubjectinfoService subInfoService;

	@RequestMapping("/getSubInfo")
	public RestResult<Subjectinfo> getSubInfo(){
		List<Subjectinfo> list = subInfoService.list();
		return RestResult.ok(list);
	}
	
	
	@RequestMapping("/updateSub")
	public RestResult<Subjectinfo> updateSub(Subjectinfo sub){
		subInfoService.updateById(sub);
		return new RestResult<>();
	}
}

